export function iframeCallback(iframeId: string, callback: (contentDocument: Document) => void) {
  const iframePage = document.querySelector("#" + iframeId) as HTMLIFrameElement;

  if (iframePage) {
    iframePage.onload = () => {
      const contentDocument = iframePage.contentDocument as Document;
      callback(contentDocument);
    }
  }
}